package com.richman.view;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import com.richman.ps38.entity.BetAdyData;
import com.richman.ps38.entity.BetDvalue;
import com.richman.ps38.entity.Event;
import com.richman.ps38.entity.HGEvent;
import com.richman.ps38.entity.HGPS38Event;
import com.richman.ps38.entity.SendData;

public class EventWindowPane extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 11L;
	
	public EventWindowPane(){
		

		
        intiComponent();  
        
        jTabbedpane.addKeyListener(new KeyAdapter() {

			@Override

			public void keyPressed(KeyEvent e) {

			super.keyPressed(e);

			char c = e.getKeyChar();

			int code = e.getKeyCode();
			
			String text  = "";
			
			if(code == 67) {
				
				text  = "Focus on inner jTabbedpane你按下的键的信息：keyChar = " + c + " KeyCode = " + code;
				
				betCentralPane.showBetWnd();
				
				System.out.println(text);
				
			}

			

			System.out.println(text);

			}

			});

        jTabbedpane.setFocusable(true);
      
	}
	
	

	
	
	JTabbedPane jTabbedpane = new JTabbedPane();// ���ѡ������  


	//HGAccountPane hgAccountPane = new HGAccountPane();
	
	
	
	public BetCentralPane betCentralPane = new BetCentralPane();
	
	BetLogPane betLogPane = new BetLogPane();

	BetAlreadyPane betAdyPane = new BetAlreadyPane();
	
	
	
	HGPS38EventPane hgps38EventPane = new HGPS38EventPane();
	
	SpecialBetAlreadyPane specialBetAdyPane = new SpecialBetAlreadyPane();
	
	BrowserPanel bp = new BrowserPanel();
	
	Ps38BrowserPanle ps38bp = new Ps38BrowserPanle();
	
	ISNBetPanel isnbp = new ISNBetPanel();

    private void intiComponent()  
    {  

		
		
		setLayout(new BorderLayout());
		

		add(jTabbedpane);  
		
		//jTabbedpane.add(hgAccountPane,"SB");
		
	//	jTabbedpane.add(hasBetListPane,"已投赛事");
		
		jTabbedpane.add(betCentralPane,"投注中心");
		
		
		
		jTabbedpane.add(betLogPane,"投注日志");

		jTabbedpane.add(betAdyPane,"进注记录");
		
		
		
		
		//jTabbedpane.add(specialBetAdyPane,"特殊进注记录");
		
		jTabbedpane.add(bp, "皇冠账目");
		
		jTabbedpane.add(ps38bp, "平博账目");
		
		jTabbedpane.add(isnbp, "ISN账目");
		
		//jTabbedpane.add(hgps38EventPane,"SB & PS38赛事");

        setBounds(100, 100, 1220, 630); 

    }

    
    

	public void updateBetCentralTable(Vector<SendData> events) {
		betCentralPane.updatePS38EventTable(events);
	}
	
	public void updateBetAdyTable(Vector<BetAdyData> events) {
		betAdyPane.updateBetAdyTable(events);
	}
	
	
	public void updateBetLogTable(Vector<BetAdyData> betLogDatas) {
		betLogPane.updateBetLogTable(betLogDatas);
	}
	
	
	public void updateHGPS38EventsTable(Vector<HGPS38Event> events) {
		hgps38EventPane.updateHGPS38EventTable(events);
	}

	public void updateBrowserAccounts(Vector<String> varAccounts) {
		bp.updateaccounts(varAccounts);
	}



	
}
